<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    
    <script>
        //对象
        var student={
            name:'张三',
            age:18,
            sex:'男'
        }
        console.log(student);  

        //添加属性
        student.telphone=10086;
        console.log(student);
        //删除属性
        delete student.telphone;
        console.log(student);

    </script>

    <script>


        var arr=['张三'];
        
        function mystudent(arr){
            
             var str='';
             var welcome='欢迎'
             var lastStr='同学'

             //  console.log(arr);
             var lastName=arr.pop();
             if(arr.lenght===1)
             {
                  str=welcome+arr[0];
             }else if(arr.lenght===2){
                  str=welcome+arr[0]+'和'+arr[1]+lastStr;
             }else{
                 str=welcome+arr+'和'+lastName+lastStr;
             }
               //   console.log(arr);
         
             return str;

        }
        
        console.log(mystudent(arr));
       


    </script>

<script>
    
</script>

</body>
</html>